<script>
	import websocket from '@/api/websocket.js';
	import $store from '@/store/index.js';
	export default {
		onLaunch: function() {
			console.log('ddchat启动。。。')
			console.log("%c 开发者：小克，QQ:2250671362",'color:#09f;font-size:32px;');
			
			if($store.state.loginUserInfo==={}||$store.state.token===''){
				console.log('用户未登录，正在重定位到登录页面...')
				uni.redirectTo({
					url:'pages/login/login'
				})
				return
			}
			//连接websocket
			websocket.initConnect();
			//获取好友列表
			$store.dispatch('getFriendList');
			///获取通知消息
			$store.dispatch('getNoticeList');
		},
		onShow: function() {
			//console.log('App Show')
		},
		onHide: function() {
			//console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
</style>
